package com.laiketui.order.api.page;


import com.laiketui.order.api.dto.MchOrderDTO;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

@Setter
@Getter
public class MyPage<T> implements Serializable {
    private static final long serialVersionUID = 8545996863226528798L;
    private List<T> records;
    private long total;
    private long size;
    private long pageSize;
    private long current;
    private long pageNum;



    public MyPage(long current, long size, long total,List<T> records) {
        this.current=current;
        this.pageNum=current;
        this.size=size;
        this.pageSize=size;
        this.total=total;
        this.records=records;
    }


    public static MyPage<MchOrderDTO> empty() {
        return new MyPage<>(1, 10, 0, Collections.emptyList());
    }
}